// eslint-disable-next-line quotes
import request from '@/utils/request'

// eslint-disable-next-line quotes
const DEPARTMENT_URL = '/v1/department'
/**
 * @param: 部门DTO
 * @return: 成功则true CommonResponse 应答码和消息统一参考基础框架
 * @see
 * @since
 */

export function add(departmentDTO) {
  return request({
    url: DEPARTMENT_URL + '/departmentAdd',
    method: 'post',
    data: departmentDTO
  })
}

/**
 * @param:
 * @return:  CommonResponse<Boolean>
 * @see
 * @since
 */

export function remove(id, version) {
  return request({
    url: DEPARTMENT_URL + '/departmentDelete',
    params: { id: id, version: version }, // id 和 发行版本
    method: 'delete'
  })
}



/**
 * @param:
 * @return:
 * @see
 * @since
 */

export function modify(departmentDTO) {
  return request({
    url: DEPARTMENT_URL + '/departmentUpdate',
    method: 'put',
    data: departmentDTO
  })
}



/**
 * @param:
 * @return:  CommonResponse<CommonPage<DepartmentVO>>
 * @see
 * @since
 */

export function commonQuery(departmentQuery) {
  return request({
    url: DEPARTMENT_URL + '/departmentQuery',
    method: 'get',
    params: departmentQuery
  })
}

export function queryDepartmentById(id) {
    
    return request({
        url: DEPARTMENT_URL + '/' + id,
        method: 'get'
    })
}



